const path=require('path')
const htmlWebpackPlugin=require('html-webpack-plugin')
const VueLoaderPlugin=require('vue-loader/lib/plugin')
module.exports={
	mode:'development',
	entry:path.join(__dirname,'./src/main.js'),
	output:{
		path:path.join(__dirname,'./dist'),
		filename:'bundle.js'
	},
	plugins:[
	//html-webpack-plugin插件，将index.html放到内存中，不需要自己使用script引入打包好的js文件，自动引入
	new htmlWebpackPlugin({
		template:path.join(__dirname,'./src/index.html'),
		filename:'index.html'
	}),new VueLoaderPlugin()

	],
	module:{
		rules:[
		{ test:/\.css$/,use:['style-loader','css-loader']},
		{ test:/\.vue$/,use:'vue-loader'},
		{ test:/\.js$/,use:'babel-loader',exclude:/node_modules/},
		{ test:/\.(png|woff|woff2|eot|ttf|svg)$/, loader: 'url-loader?limit=100000'},
		{ test:/\.scss$/,use:['style-loader','css-loader','sass-loader']},
		{ test:/\.(jpg|png|gif|bmp|jpeg)$/,use:'url-loader?limit=100000'}
		
		]

	}
};